/*
 * Lenovo Group
 * Copyright (c) 2015-2016 All Rights Reserved.
 * Project Name: lmrp-android app
 * Create Time: 16-2-16 下午6:32
 */

package com.lenovo.mso2o.rest;


import com.lenovo.framework.entity.Res;
import com.lenovo.mso2o.entity.CustomerInfoRes;
import com.lenovo.mso2o.entity.EngineerDetailResponse;
import com.lenovo.mso2o.entity.EngineerLocInfoRequest;
import com.lenovo.mso2o.entity.EngineerSettingStateRequest;
import com.lenovo.mso2o.entity.ModeNumber;
import com.lenovo.mso2o.entity.ModifyEngineerInfoRequest;
import com.lenovo.mso2o.entity.MvsUser;
import com.lenovo.mso2o.entity.PasswordApplyingRequest;
import com.lenovo.mso2o.entity.ProjectInfoRes;
import com.lenovo.mso2o.entity.ProjectListRequest;
import com.lenovo.mso2o.entity.UserSyncInfo;
import com.lenovo.mso2o.entity.WorkingAchivement;

import java.util.ArrayList;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import rx.Observable;


public interface UserAPI {
     @POST("api/user/appConfig")
     @FormUrlEncoded
     Call<Res<String>> appConfig(@Field("appConfigJson") String config);

     @POST("engineers/{engineerid}/position")
     Observable<Res> uploadGPSInfo(@Path("engineerid") String engineerid, @Body UserSyncInfo gpsInfo);

     @POST("api/user/userDetail")
     Call<Res<MvsUser>> userDetail();

     @GET("engineers/{engineerid}")
     Observable<Res<EngineerDetailResponse>> userDetail(@Path("engineerid") String id);

     @POST("api/user/getBillNum")
     Call<Res<ArrayList<ModeNumber>>>  getBillNumber();
     @POST("api/user/modifyPass")
     @FormUrlEncoded
     Call<Res> modifyPassword(@Field("password") String newPassword,//新密码
                                 @Field("oldPassword") String oldPassword);//旧密码

     @POST("api/user/engineerHistoryData")
     @FormUrlEncoded
     Call<Res<WorkingAchivement>> getHistoryAchievements(@Field("monthNum") String time);
     //3.11获取客户信息,路径需要加上api
     @GET ("clients/{clientid}")
     Observable<Res<CustomerInfoRes>> getClientMsg(@Path("clientid") String client_id);
     //3.12 获取项目列表,路径需要加上api
     @GET ("projects")
     Observable<Res<ProjectInfoRes>> getProjectList(@Body ProjectListRequest projectListRequest);
     //3.13 获取项目信息,路径需要加上api
     @GET("projects/{projectid}")
     Observable<Res<ProjectInfoRes>> getProjectMsg(@Path("projectid") String project_id);
     //3.14获取工程师信息
     @GET("engineers/{engineerid}")
     Observable<Res<EngineerDetailResponse>> getEngineerMsg(@Path("engineerid") String engineer_id);
     //3.15工程师设置状态
     @PUT("engineers/{engineerid}/status")
     Observable<Res> getEngineerStatus(@Body EngineerSettingStateRequest engineerSettingStateRequest);
     //3.16重置工程师密码-获取验证码
     @GET("engineers/{loginname}/securitycode")
     Observable<Res> resetEngineerPassword(@Path("loginname") String login_name);
     //3.17 重置工程师密码-提交申请
     @POST("engineers/password")
     Observable<Res> confirmRequest(@Body PasswordApplyingRequest passwordApplyingRequest);
     //3.18修改工程师信息
     @PUT("engineers/{engineerid}")
     Observable<Res> modifyEngineerMsg(@Path("engineerid") String engineer_di, @Body ModifyEngineerInfoRequest modifyEngineerInfoRequest);
     //3.19工程师位置信息
     @PUT("engineers/{engineerid}/position")
     Observable<Res> getEngineerLocalMsg(@Path("engineerid") String engineer_id,@Body EngineerLocInfoRequest engineerLocInfoRequest);

}
